package com.abso.sunlight.api;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.dom4j.Element;

/**
 * Lobbying issue.
 */
public class FilingIssue {

    /** Senate-defined category code (eg. AGRICULTURE). */
    private String code;

    /** Description of specific lobbying issue as provided by registrant. */
    private String specificIssue;

    /**
     * Constructs a new lobbying issue.
     * 
     * @param elem
     *            the XML holding issue.
     */
    public FilingIssue(Element elem) {
        this.code = SunlightDataUtils.getString(elem, "code");
        this.specificIssue = SunlightDataUtils.getString(elem, "specific_issue");
    }

    /**
     * Returns senate-defined category code (eg. AGRICULTURE).
     * 
     * @return senate-defined category code (eg. AGRICULTURE).
     */
    public String getCode() {
        return code;
    }

    /**
     * Returns description of specific lobbying issue as provided by registrant .
     * 
     * @return description of specific lobbying issue as provided by registrant .
     */
    public String getSpecificIssue() {
        return specificIssue;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
    }

}
